import { ESGeoWater } from "esobjs-xe2-plugin/dist-node/esobjs-xe2-plugin-main";
import { EnumProperty, JsonProperty } from "xbsj-xe2/dist-node/xe2-base-objects";
import { PartialWithUndefinedReactivePropsToNativeProps, ReactivePropsToNativePropsAndChanged, extendClassProps, reactJsonWithUndefined } from "xbsj-xe2/dist-node/xe2-base-utils";
import { SceneObjectKey } from "xbsj-xe2/dist-node/xe2-utils";

/**
 * 测试 水面修补
 */
export class ESMsWater extends ESGeoWater {
    static override readonly type = this.register('ESMsWater', this, { chsName: '水面修补', tags: ['ESObjects', '_ES_Impl_Cesium', '_ES_Impl_UE'], description: "地理多边形体" });
    override get typeName() { return 'ESMsWater'; }
    override get defaultProps() { return ESMsWater.createDefaultProps(); }
    override get json() { 
        return {
            // @ts-ignore
            ...this._innerGetJson(),
            "textureSize": this.textureSize,
            "textureId": this.textureId,
        } as JsonType;
     }
    override set json(value: JsonType) { this._innerSetJson(value); }

    constructor(id?: SceneObjectKey) {
        super(id);
        // this.show = false
    }
    override getESProperties() {
        const properties = { ...super.getESProperties() };
        return {
            ...properties,
            coordinate: [
                ...properties.coordinate,
            ]
        };
    };
    override getProperties(language: string) {
        return [
            ...super.getProperties(language),
        ];
    }
}

export namespace ESMsWater {
    export const createDefaultProps = () => ({
        ...ESGeoWater.createDefaultProps(),
        textureSize: undefined as string | undefined,
        textureId: undefined as string | undefined,
        srcGeom: reactJsonWithUndefined<{ [xx: string]: any }>(undefined),

    });
}
extendClassProps(ESMsWater.prototype, ESMsWater.createDefaultProps);
export interface ESMsWater extends ReactivePropsToNativePropsAndChanged<ReturnType<typeof ESMsWater.createDefaultProps>> { }
type JsonType = PartialWithUndefinedReactivePropsToNativeProps<ReturnType<typeof ESMsWater.createDefaultProps> & { type: string }>;